package com.dailyblue.java.spring.consumer.handler;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.dailyblue.cloud.bookstore.commons.util.JsonResult;
import com.dailyblue.cloud.bookstore.commons.util.ResultTool;
import org.springframework.stereotype.Component;

@Component
public class BlockDemoHandler {

    public static JsonResult abc(BlockException e) {
        System.out.println("abc:");
        return ResultTool.fail();
    }

    public static JsonResult abcd(Throwable e) {
        System.out.println("abcd:" + e.getMessage());
        return ResultTool.fail();
    }
}
